import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../assets.dart';
import '../generated/l10n.dart';
import 'home_logic.dart';

class homePage extends StatelessWidget {
  final oneLogic logic = Get.put(oneLogic());

  Map<String, dynamic?>? _ps;

  homePage({Map<String, dynamic?>? ps}) : _ps = ps;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(S.of(context).title + _ps.toString())),
      body: Center(
        child: Obx(
          () => Text('点击了 ${logic.count.value} 次',
              style: TextStyle(fontSize: 30.0)),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => logic.increase(),
        child: Image.asset(
          Assets.lib_login_img_ic_launcher_png,
          package: Assets.package,
        ),
      ),
    );
  }
}
